"""
@author: Sergiy Tsymbalyuk
"""

import logging

from repoze.what.plugins.pylonshq import ControllerProtector

from chowa.lib.site.crud import FlatCrudController
from hrms.lib.predicates import profile
from hrms.model.education import Education, Specialty

log = logging.getLogger(__name__)

@ControllerProtector(profile())
class EducationController(FlatCrudController):
    __model__ = Education
    __columns__ = ['specialty.school', 'specialty', 'diploma_series', 'diploma_no', 'stage', 'graduated']
    __edit_columns__ = ['specialty', 'diploma_series', 'diploma_no', 'stage', 'graduated']
    __filters__ = {'specialty_id': (Specialty, 'school')}
